package com.walkingfiles.registry

class File {

    FileType type
    String name
    String description
    byte[] data	
	Date dateCreated
    Date created	
    Document document

    static constraints = {
        data(nullable: false, maxSize: 1024 * 1024 * 20) // 20MB
        name(nullable:false)
        type(nullable:false)
        document(nullable:false)
    }

    String toString() {
        String.format("%1s: %1s", name, description)
    }
	
	static mapping = {
		table 'Files'
	}

}
